<template>
	<view class="base-cloud">
		
		
		<view class="h100p whiteBg w100p shadow pd10 mt10 rds5">
			<view class="fz16  pd10 bold  brown bb">{{ title }}</view>
			<view class="fz14  pt15  ">
				<block v-for="(x , index) in datalist" :key="index">
						
				<button class="roundBtn line yellowBg" @click="gotlist(x._id,x.name)">{{x.name}}</button>
				
				</block>
				
			</view>
		
		</view>
	
		
	</view>
</template>

<script>
	
	export default {
		name: 'kenyCateList',		
		props: {
			title: {
				type: String,
				default: ''
			}, // 列表标题
						
			actionUrl:{
				type: String,
				default: 'api/cate/list'
			},
			params:{
				type:[Object,String],
				default: "{}"
			}
		},
		data() {
			return {				
				conditions: {},
				loading: true ,				
				datalist: [],
			}
		},	
		
		created() {			
			this.conditions = Object.assign(this.conditions,this.params);			
			var that = this ;
			this.getPage();
		},
		
		methods: {
			getPage:function(e){
				this.bcc.callInCache({
					url : this.actionUrl ,
					success : e => { 
						this.datalist = e.list;
						this.loading = false ;
					}
				});
			},
			gotlist(e,name){
				
				uni.navigateTo({
					url: "/pages/web/list?id="+e+"&name="+name
				})
				
			}
			
			
			
		}
	}
</script>
